package bb.lanxing.calc.data;

import com.github.mikephil.charting.utils.Utils;

public class CadencePoint implements Cloneable, RecycleData {
    private float altitude;
    private int cadence;
    private int cadenceTime;
    private double distance;
    private boolean isCalibrated;
    private int pressure;
    private float realPressure;
    private float realTemperature;
    private int source = 2;
    private double speed;
    private int sumCadence;
    private int sumDistance;
    private int sumDuration;
    private int sumWheel;
    private int temperature;
    private int wheelRpm;
    private int wheelTime;

    public CadencePoint copy(CadencePoint reuse) {
        if (reuse == null) {
            reuse = new CadencePoint();
        }
        reuse.sumCadence = this.sumCadence;
        reuse.cadenceTime = this.cadenceTime;
        reuse.sumWheel = this.sumWheel;
        reuse.wheelTime = this.wheelTime;
        reuse.pressure = this.pressure;
        reuse.temperature = this.temperature;
        reuse.cadence = this.cadence;
        reuse.wheelRpm = this.wheelRpm;
        reuse.speed = this.speed;
        reuse.distance = this.distance;
        reuse.realPressure = this.realPressure;
        reuse.realTemperature = this.realTemperature;
        reuse.altitude = this.altitude;
        reuse.isCalibrated = this.isCalibrated;
        reuse.source = this.source;
        reuse.sumDuration = this.sumDuration;
        reuse.sumDistance = this.sumDistance;
        return reuse;
    }

    public CadencePoint clone() {
        try {
            return (CadencePoint) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public void recycle() {
        this.sumCadence = 0;
        this.cadenceTime = 0;
        this.sumWheel = 0;
        this.wheelTime = 0;
        this.pressure = 0;
        this.temperature = 0;
        this.cadence = 0;
        this.wheelRpm = 0;
        this.speed = Utils.DOUBLE_EPSILON;
        this.distance = Utils.DOUBLE_EPSILON;
        this.realPressure = 0.0f;
        this.realTemperature = 0.0f;
        this.altitude = 0.0f;
        this.isCalibrated = false;
        this.source = 2;
        this.sumDuration = 0;
        this.sumDistance = 0;
    }

    public int getSumCadence() {
        return this.sumCadence;
    }

    public void setSumCadence(int sumCadence) {
        this.sumCadence = sumCadence;
    }

    public int getCadenceTime() {
        return this.cadenceTime;
    }

    public void setCadenceTime(int cadenceTime) {
        this.cadenceTime = cadenceTime;
    }

    public int getSumWheel() {
        return this.sumWheel;
    }

    public void setSumWheel(int sumWheel) {
        this.sumWheel = sumWheel;
    }

    public int getWheelTime() {
        return this.wheelTime;
    }

    public void setWheelTime(int wheelTime) {
        this.wheelTime = wheelTime;
    }

    public int getPressure() {
        return this.pressure;
    }

    public void setPressure(int pressure) {
        this.pressure = pressure;
    }

    public int getTemperature() {
        return this.temperature;
    }

    public void setTemperature(int temperature) {
        this.temperature = temperature;
    }

    public int getCadence() {
        return this.cadence;
    }

    public void setCadence(int cadence) {
        this.cadence = cadence;
    }

    public int getWheelRpm() {
        return this.wheelRpm;
    }

    public void setWheelRpm(int wheelRpm) {
        this.wheelRpm = wheelRpm;
    }

    public double getSpeed() {
        return this.speed;
    }

    public void setSpeed(double speed) {
        this.speed = speed;
    }

    public double getDistance() {
        return this.distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    public float getRealPressure() {
        return this.realPressure;
    }

    public void setRealPressure(float realPressure) {
        this.realPressure = realPressure;
    }

    public float getRealTemperature() {
        return this.realTemperature;
    }

    public void setRealTemperature(float realTemperature) {
        this.realTemperature = realTemperature;
    }

    public float getAltitude() {
        return this.altitude;
    }

    public void setAltitude(float altitude) {
        this.altitude = altitude;
    }

    public boolean isCalibrated() {
        return this.isCalibrated;
    }

    public void setCalibrated(boolean calibrated) {
        this.isCalibrated = calibrated;
    }

    public int getSource() {
        return this.source;
    }

    public void setSource(int source) {
        this.source = source;
    }

    public int getSumDuration() {
        return this.sumDuration;
    }

    public void setSumDuration(int sumDuration) {
        this.sumDuration = sumDuration;
    }

    public int getSumDistance() {
        return this.sumDistance;
    }

    public void setSumDistance(int sumDistance) {
        this.sumDistance = sumDistance;
    }
}
